
/**
 * This is a generated class and is not intended for modification.  
 */
package com.model.valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _VoCompanyMasterEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("cre_datetime", "company_email", "serialnumber", "company_address1", "country_name", "company_city", "company_fax", "cre_userid", "company_url", "country_serialnumber_fk", "gst_code", "company_name", "state_serialnumber_fk", "company_address2", "company_regno1", "company_phone", "activestatus", "company_zip");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("cre_datetime", "company_email", "serialnumber", "company_address1", "country_name", "company_city", "company_fax", "cre_userid", "company_url", "country_serialnumber_fk", "gst_code", "company_name", "state_serialnumber_fk", "company_address2", "company_regno1", "company_phone", "activestatus", "company_zip");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("cre_datetime", "company_email", "serialnumber", "company_address1", "country_name", "company_city", "company_fax", "cre_userid", "company_url", "country_serialnumber_fk", "gst_code", "company_name", "state_serialnumber_fk", "company_address2", "company_regno1", "company_phone", "activestatus", "company_zip");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("cre_datetime", "company_email", "serialnumber", "company_address1", "country_name", "company_city", "company_fax", "cre_userid", "company_url", "country_serialnumber_fk", "gst_code", "company_name", "state_serialnumber_fk", "company_address2", "company_regno1", "company_phone", "activestatus", "company_zip");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "VoCompanyMaster";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();

    
    model_internal var _cre_datetimeIsValid:Boolean;
    model_internal var _cre_datetimeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _cre_datetimeIsValidCacheInitialized:Boolean = false;
    model_internal var _cre_datetimeValidationFailureMessages:Array;
    
    model_internal var _company_emailIsValid:Boolean;
    model_internal var _company_emailValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_emailIsValidCacheInitialized:Boolean = false;
    model_internal var _company_emailValidationFailureMessages:Array;
    
    model_internal var _company_address1IsValid:Boolean;
    model_internal var _company_address1Validator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_address1IsValidCacheInitialized:Boolean = false;
    model_internal var _company_address1ValidationFailureMessages:Array;
    
    model_internal var _country_nameIsValid:Boolean;
    model_internal var _country_nameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _country_nameIsValidCacheInitialized:Boolean = false;
    model_internal var _country_nameValidationFailureMessages:Array;
    
    model_internal var _company_cityIsValid:Boolean;
    model_internal var _company_cityValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_cityIsValidCacheInitialized:Boolean = false;
    model_internal var _company_cityValidationFailureMessages:Array;
    
    model_internal var _company_faxIsValid:Boolean;
    model_internal var _company_faxValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_faxIsValidCacheInitialized:Boolean = false;
    model_internal var _company_faxValidationFailureMessages:Array;
    
    model_internal var _company_urlIsValid:Boolean;
    model_internal var _company_urlValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_urlIsValidCacheInitialized:Boolean = false;
    model_internal var _company_urlValidationFailureMessages:Array;
    
    model_internal var _gst_codeIsValid:Boolean;
    model_internal var _gst_codeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _gst_codeIsValidCacheInitialized:Boolean = false;
    model_internal var _gst_codeValidationFailureMessages:Array;
    
    model_internal var _company_nameIsValid:Boolean;
    model_internal var _company_nameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_nameIsValidCacheInitialized:Boolean = false;
    model_internal var _company_nameValidationFailureMessages:Array;
    
    model_internal var _company_address2IsValid:Boolean;
    model_internal var _company_address2Validator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_address2IsValidCacheInitialized:Boolean = false;
    model_internal var _company_address2ValidationFailureMessages:Array;
    
    model_internal var _company_regno1IsValid:Boolean;
    model_internal var _company_regno1Validator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_regno1IsValidCacheInitialized:Boolean = false;
    model_internal var _company_regno1ValidationFailureMessages:Array;
    
    model_internal var _company_phoneIsValid:Boolean;
    model_internal var _company_phoneValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_phoneIsValidCacheInitialized:Boolean = false;
    model_internal var _company_phoneValidationFailureMessages:Array;
    
    model_internal var _activestatusIsValid:Boolean;
    model_internal var _activestatusValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _activestatusIsValidCacheInitialized:Boolean = false;
    model_internal var _activestatusValidationFailureMessages:Array;
    
    model_internal var _company_zipIsValid:Boolean;
    model_internal var _company_zipValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _company_zipIsValidCacheInitialized:Boolean = false;
    model_internal var _company_zipValidationFailureMessages:Array;

    model_internal var _instance:_Super_VoCompanyMaster;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _VoCompanyMasterEntityMetadata(value : _Super_VoCompanyMaster)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // depenents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["cre_datetime"] = new Array();
            model_internal::dependentsOnMap["company_email"] = new Array();
            model_internal::dependentsOnMap["serialnumber"] = new Array();
            model_internal::dependentsOnMap["company_address1"] = new Array();
            model_internal::dependentsOnMap["country_name"] = new Array();
            model_internal::dependentsOnMap["company_city"] = new Array();
            model_internal::dependentsOnMap["company_fax"] = new Array();
            model_internal::dependentsOnMap["cre_userid"] = new Array();
            model_internal::dependentsOnMap["company_url"] = new Array();
            model_internal::dependentsOnMap["country_serialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["gst_code"] = new Array();
            model_internal::dependentsOnMap["company_name"] = new Array();
            model_internal::dependentsOnMap["state_serialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["company_address2"] = new Array();
            model_internal::dependentsOnMap["company_regno1"] = new Array();
            model_internal::dependentsOnMap["company_phone"] = new Array();
            model_internal::dependentsOnMap["activestatus"] = new Array();
            model_internal::dependentsOnMap["company_zip"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object()
        }

        model_internal::_instance = value;
        model_internal::_cre_datetimeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCre_datetime);
        model_internal::_cre_datetimeValidator.required = true;
        model_internal::_cre_datetimeValidator.requiredFieldError = "cre_datetime is required";
        //model_internal::_cre_datetimeValidator.source = model_internal::_instance;
        //model_internal::_cre_datetimeValidator.property = "cre_datetime";
        model_internal::_company_emailValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_email);
        model_internal::_company_emailValidator.required = true;
        model_internal::_company_emailValidator.requiredFieldError = "company_email is required";
        //model_internal::_company_emailValidator.source = model_internal::_instance;
        //model_internal::_company_emailValidator.property = "company_email";
        model_internal::_company_address1Validator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_address1);
        model_internal::_company_address1Validator.required = true;
        model_internal::_company_address1Validator.requiredFieldError = "company_address1 is required";
        //model_internal::_company_address1Validator.source = model_internal::_instance;
        //model_internal::_company_address1Validator.property = "company_address1";
        model_internal::_country_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCountry_name);
        model_internal::_country_nameValidator.required = true;
        model_internal::_country_nameValidator.requiredFieldError = "country_name is required";
        //model_internal::_country_nameValidator.source = model_internal::_instance;
        //model_internal::_country_nameValidator.property = "country_name";
        model_internal::_company_cityValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_city);
        model_internal::_company_cityValidator.required = true;
        model_internal::_company_cityValidator.requiredFieldError = "company_city is required";
        //model_internal::_company_cityValidator.source = model_internal::_instance;
        //model_internal::_company_cityValidator.property = "company_city";
        model_internal::_company_faxValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_fax);
        model_internal::_company_faxValidator.required = true;
        model_internal::_company_faxValidator.requiredFieldError = "company_fax is required";
        //model_internal::_company_faxValidator.source = model_internal::_instance;
        //model_internal::_company_faxValidator.property = "company_fax";
        model_internal::_company_urlValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_url);
        model_internal::_company_urlValidator.required = true;
        model_internal::_company_urlValidator.requiredFieldError = "company_url is required";
        //model_internal::_company_urlValidator.source = model_internal::_instance;
        //model_internal::_company_urlValidator.property = "company_url";
        model_internal::_gst_codeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForGst_code);
        model_internal::_gst_codeValidator.required = true;
        model_internal::_gst_codeValidator.requiredFieldError = "gst_code is required";
        //model_internal::_gst_codeValidator.source = model_internal::_instance;
        //model_internal::_gst_codeValidator.property = "gst_code";
        model_internal::_company_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_name);
        model_internal::_company_nameValidator.required = true;
        model_internal::_company_nameValidator.requiredFieldError = "company_name is required";
        //model_internal::_company_nameValidator.source = model_internal::_instance;
        //model_internal::_company_nameValidator.property = "company_name";
        model_internal::_company_address2Validator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_address2);
        model_internal::_company_address2Validator.required = true;
        model_internal::_company_address2Validator.requiredFieldError = "company_address2 is required";
        //model_internal::_company_address2Validator.source = model_internal::_instance;
        //model_internal::_company_address2Validator.property = "company_address2";
        model_internal::_company_regno1Validator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_regno1);
        model_internal::_company_regno1Validator.required = true;
        model_internal::_company_regno1Validator.requiredFieldError = "company_regno1 is required";
        //model_internal::_company_regno1Validator.source = model_internal::_instance;
        //model_internal::_company_regno1Validator.property = "company_regno1";
        model_internal::_company_phoneValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_phone);
        model_internal::_company_phoneValidator.required = true;
        model_internal::_company_phoneValidator.requiredFieldError = "company_phone is required";
        //model_internal::_company_phoneValidator.source = model_internal::_instance;
        //model_internal::_company_phoneValidator.property = "company_phone";
        model_internal::_activestatusValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForActivestatus);
        model_internal::_activestatusValidator.required = true;
        model_internal::_activestatusValidator.requiredFieldError = "activestatus is required";
        //model_internal::_activestatusValidator.source = model_internal::_instance;
        //model_internal::_activestatusValidator.property = "activestatus";
        model_internal::_company_zipValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCompany_zip);
        model_internal::_company_zipValidator.required = true;
        model_internal::_company_zipValidator.requiredFieldError = "company_zip is required";
        //model_internal::_company_zipValidator.source = model_internal::_instance;
        //model_internal::_company_zipValidator.property = "company_zip";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::dataProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity VoCompanyMaster");  
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity VoCompanyMaster");  

        return model_internal::collectionBaseMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoCompanyMaster");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::dataProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a data property of entity VoCompanyMaster");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoCompanyMaster");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isCre_datetimeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_emailAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSerialnumberAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_address1Available():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCountry_nameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_cityAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_faxAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCre_useridAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_urlAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCountry_serialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isGst_codeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_nameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isState_serialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_address2Available():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_regno1Available():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_phoneAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isActivestatusAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCompany_zipAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnCre_datetime():void
    {
        if (model_internal::_cre_datetimeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCre_datetime = null;
            model_internal::calculateCre_datetimeIsValid();
        }
    }
    public function invalidateDependentOnCompany_email():void
    {
        if (model_internal::_company_emailIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_email = null;
            model_internal::calculateCompany_emailIsValid();
        }
    }
    public function invalidateDependentOnCompany_address1():void
    {
        if (model_internal::_company_address1IsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_address1 = null;
            model_internal::calculateCompany_address1IsValid();
        }
    }
    public function invalidateDependentOnCountry_name():void
    {
        if (model_internal::_country_nameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCountry_name = null;
            model_internal::calculateCountry_nameIsValid();
        }
    }
    public function invalidateDependentOnCompany_city():void
    {
        if (model_internal::_company_cityIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_city = null;
            model_internal::calculateCompany_cityIsValid();
        }
    }
    public function invalidateDependentOnCompany_fax():void
    {
        if (model_internal::_company_faxIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_fax = null;
            model_internal::calculateCompany_faxIsValid();
        }
    }
    public function invalidateDependentOnCompany_url():void
    {
        if (model_internal::_company_urlIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_url = null;
            model_internal::calculateCompany_urlIsValid();
        }
    }
    public function invalidateDependentOnGst_code():void
    {
        if (model_internal::_gst_codeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfGst_code = null;
            model_internal::calculateGst_codeIsValid();
        }
    }
    public function invalidateDependentOnCompany_name():void
    {
        if (model_internal::_company_nameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_name = null;
            model_internal::calculateCompany_nameIsValid();
        }
    }
    public function invalidateDependentOnCompany_address2():void
    {
        if (model_internal::_company_address2IsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_address2 = null;
            model_internal::calculateCompany_address2IsValid();
        }
    }
    public function invalidateDependentOnCompany_regno1():void
    {
        if (model_internal::_company_regno1IsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_regno1 = null;
            model_internal::calculateCompany_regno1IsValid();
        }
    }
    public function invalidateDependentOnCompany_phone():void
    {
        if (model_internal::_company_phoneIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_phone = null;
            model_internal::calculateCompany_phoneIsValid();
        }
    }
    public function invalidateDependentOnActivestatus():void
    {
        if (model_internal::_activestatusIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfActivestatus = null;
            model_internal::calculateActivestatusIsValid();
        }
    }
    public function invalidateDependentOnCompany_zip():void
    {
        if (model_internal::_company_zipIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCompany_zip = null;
            model_internal::calculateCompany_zipIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get cre_datetimeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get cre_datetimeValidator() : StyleValidator
    {
        return model_internal::_cre_datetimeValidator;
    }

    model_internal function set _cre_datetimeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_cre_datetimeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_cre_datetimeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetimeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetimeIsValid():Boolean
    {
        if (!model_internal::_cre_datetimeIsValidCacheInitialized)
        {
            model_internal::calculateCre_datetimeIsValid();
        }

        return model_internal::_cre_datetimeIsValid;
    }

    model_internal function calculateCre_datetimeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_cre_datetimeValidator.validate(model_internal::_instance.cre_datetime)
        model_internal::_cre_datetimeIsValid_der = (valRes.results == null);
        model_internal::_cre_datetimeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::cre_datetimeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::cre_datetimeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetimeValidationFailureMessages():Array
    {
        if (model_internal::_cre_datetimeValidationFailureMessages == null)
            model_internal::calculateCre_datetimeIsValid();

        return _cre_datetimeValidationFailureMessages;
    }

    model_internal function set cre_datetimeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_cre_datetimeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_cre_datetimeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetimeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_emailStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_emailValidator() : StyleValidator
    {
        return model_internal::_company_emailValidator;
    }

    model_internal function set _company_emailIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_emailIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_emailIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_emailIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_emailIsValid():Boolean
    {
        if (!model_internal::_company_emailIsValidCacheInitialized)
        {
            model_internal::calculateCompany_emailIsValid();
        }

        return model_internal::_company_emailIsValid;
    }

    model_internal function calculateCompany_emailIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_emailValidator.validate(model_internal::_instance.company_email)
        model_internal::_company_emailIsValid_der = (valRes.results == null);
        model_internal::_company_emailIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_emailValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_emailValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_emailValidationFailureMessages():Array
    {
        if (model_internal::_company_emailValidationFailureMessages == null)
            model_internal::calculateCompany_emailIsValid();

        return _company_emailValidationFailureMessages;
    }

    model_internal function set company_emailValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_emailValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_emailValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_emailValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get serialnumberStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get company_address1Style():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_address1Validator() : StyleValidator
    {
        return model_internal::_company_address1Validator;
    }

    model_internal function set _company_address1IsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_address1IsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_address1IsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_address1IsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_address1IsValid():Boolean
    {
        if (!model_internal::_company_address1IsValidCacheInitialized)
        {
            model_internal::calculateCompany_address1IsValid();
        }

        return model_internal::_company_address1IsValid;
    }

    model_internal function calculateCompany_address1IsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_address1Validator.validate(model_internal::_instance.company_address1)
        model_internal::_company_address1IsValid_der = (valRes.results == null);
        model_internal::_company_address1IsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_address1ValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_address1ValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_address1ValidationFailureMessages():Array
    {
        if (model_internal::_company_address1ValidationFailureMessages == null)
            model_internal::calculateCompany_address1IsValid();

        return _company_address1ValidationFailureMessages;
    }

    model_internal function set company_address1ValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_address1ValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_address1ValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_address1ValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get country_nameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get country_nameValidator() : StyleValidator
    {
        return model_internal::_country_nameValidator;
    }

    model_internal function set _country_nameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_country_nameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_country_nameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "country_nameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get country_nameIsValid():Boolean
    {
        if (!model_internal::_country_nameIsValidCacheInitialized)
        {
            model_internal::calculateCountry_nameIsValid();
        }

        return model_internal::_country_nameIsValid;
    }

    model_internal function calculateCountry_nameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_country_nameValidator.validate(model_internal::_instance.country_name)
        model_internal::_country_nameIsValid_der = (valRes.results == null);
        model_internal::_country_nameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::country_nameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::country_nameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get country_nameValidationFailureMessages():Array
    {
        if (model_internal::_country_nameValidationFailureMessages == null)
            model_internal::calculateCountry_nameIsValid();

        return _country_nameValidationFailureMessages;
    }

    model_internal function set country_nameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_country_nameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_country_nameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "country_nameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_cityStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_cityValidator() : StyleValidator
    {
        return model_internal::_company_cityValidator;
    }

    model_internal function set _company_cityIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_cityIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_cityIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_cityIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_cityIsValid():Boolean
    {
        if (!model_internal::_company_cityIsValidCacheInitialized)
        {
            model_internal::calculateCompany_cityIsValid();
        }

        return model_internal::_company_cityIsValid;
    }

    model_internal function calculateCompany_cityIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_cityValidator.validate(model_internal::_instance.company_city)
        model_internal::_company_cityIsValid_der = (valRes.results == null);
        model_internal::_company_cityIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_cityValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_cityValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_cityValidationFailureMessages():Array
    {
        if (model_internal::_company_cityValidationFailureMessages == null)
            model_internal::calculateCompany_cityIsValid();

        return _company_cityValidationFailureMessages;
    }

    model_internal function set company_cityValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_cityValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_cityValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_cityValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_faxStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_faxValidator() : StyleValidator
    {
        return model_internal::_company_faxValidator;
    }

    model_internal function set _company_faxIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_faxIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_faxIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_faxIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_faxIsValid():Boolean
    {
        if (!model_internal::_company_faxIsValidCacheInitialized)
        {
            model_internal::calculateCompany_faxIsValid();
        }

        return model_internal::_company_faxIsValid;
    }

    model_internal function calculateCompany_faxIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_faxValidator.validate(model_internal::_instance.company_fax)
        model_internal::_company_faxIsValid_der = (valRes.results == null);
        model_internal::_company_faxIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_faxValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_faxValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_faxValidationFailureMessages():Array
    {
        if (model_internal::_company_faxValidationFailureMessages == null)
            model_internal::calculateCompany_faxIsValid();

        return _company_faxValidationFailureMessages;
    }

    model_internal function set company_faxValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_faxValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_faxValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_faxValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get cre_useridStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get company_urlStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_urlValidator() : StyleValidator
    {
        return model_internal::_company_urlValidator;
    }

    model_internal function set _company_urlIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_urlIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_urlIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_urlIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_urlIsValid():Boolean
    {
        if (!model_internal::_company_urlIsValidCacheInitialized)
        {
            model_internal::calculateCompany_urlIsValid();
        }

        return model_internal::_company_urlIsValid;
    }

    model_internal function calculateCompany_urlIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_urlValidator.validate(model_internal::_instance.company_url)
        model_internal::_company_urlIsValid_der = (valRes.results == null);
        model_internal::_company_urlIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_urlValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_urlValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_urlValidationFailureMessages():Array
    {
        if (model_internal::_company_urlValidationFailureMessages == null)
            model_internal::calculateCompany_urlIsValid();

        return _company_urlValidationFailureMessages;
    }

    model_internal function set company_urlValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_urlValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_urlValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_urlValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get country_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get gst_codeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get gst_codeValidator() : StyleValidator
    {
        return model_internal::_gst_codeValidator;
    }

    model_internal function set _gst_codeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_gst_codeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_gst_codeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "gst_codeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get gst_codeIsValid():Boolean
    {
        if (!model_internal::_gst_codeIsValidCacheInitialized)
        {
            model_internal::calculateGst_codeIsValid();
        }

        return model_internal::_gst_codeIsValid;
    }

    model_internal function calculateGst_codeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_gst_codeValidator.validate(model_internal::_instance.gst_code)
        model_internal::_gst_codeIsValid_der = (valRes.results == null);
        model_internal::_gst_codeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::gst_codeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::gst_codeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get gst_codeValidationFailureMessages():Array
    {
        if (model_internal::_gst_codeValidationFailureMessages == null)
            model_internal::calculateGst_codeIsValid();

        return _gst_codeValidationFailureMessages;
    }

    model_internal function set gst_codeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_gst_codeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_gst_codeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "gst_codeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_nameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_nameValidator() : StyleValidator
    {
        return model_internal::_company_nameValidator;
    }

    model_internal function set _company_nameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_nameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_nameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_nameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_nameIsValid():Boolean
    {
        if (!model_internal::_company_nameIsValidCacheInitialized)
        {
            model_internal::calculateCompany_nameIsValid();
        }

        return model_internal::_company_nameIsValid;
    }

    model_internal function calculateCompany_nameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_nameValidator.validate(model_internal::_instance.company_name)
        model_internal::_company_nameIsValid_der = (valRes.results == null);
        model_internal::_company_nameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_nameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_nameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_nameValidationFailureMessages():Array
    {
        if (model_internal::_company_nameValidationFailureMessages == null)
            model_internal::calculateCompany_nameIsValid();

        return _company_nameValidationFailureMessages;
    }

    model_internal function set company_nameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_nameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_nameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_nameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get state_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get company_address2Style():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_address2Validator() : StyleValidator
    {
        return model_internal::_company_address2Validator;
    }

    model_internal function set _company_address2IsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_address2IsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_address2IsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_address2IsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_address2IsValid():Boolean
    {
        if (!model_internal::_company_address2IsValidCacheInitialized)
        {
            model_internal::calculateCompany_address2IsValid();
        }

        return model_internal::_company_address2IsValid;
    }

    model_internal function calculateCompany_address2IsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_address2Validator.validate(model_internal::_instance.company_address2)
        model_internal::_company_address2IsValid_der = (valRes.results == null);
        model_internal::_company_address2IsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_address2ValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_address2ValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_address2ValidationFailureMessages():Array
    {
        if (model_internal::_company_address2ValidationFailureMessages == null)
            model_internal::calculateCompany_address2IsValid();

        return _company_address2ValidationFailureMessages;
    }

    model_internal function set company_address2ValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_address2ValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_address2ValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_address2ValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_regno1Style():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_regno1Validator() : StyleValidator
    {
        return model_internal::_company_regno1Validator;
    }

    model_internal function set _company_regno1IsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_regno1IsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_regno1IsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_regno1IsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_regno1IsValid():Boolean
    {
        if (!model_internal::_company_regno1IsValidCacheInitialized)
        {
            model_internal::calculateCompany_regno1IsValid();
        }

        return model_internal::_company_regno1IsValid;
    }

    model_internal function calculateCompany_regno1IsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_regno1Validator.validate(model_internal::_instance.company_regno1)
        model_internal::_company_regno1IsValid_der = (valRes.results == null);
        model_internal::_company_regno1IsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_regno1ValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_regno1ValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_regno1ValidationFailureMessages():Array
    {
        if (model_internal::_company_regno1ValidationFailureMessages == null)
            model_internal::calculateCompany_regno1IsValid();

        return _company_regno1ValidationFailureMessages;
    }

    model_internal function set company_regno1ValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_regno1ValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_regno1ValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_regno1ValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_phoneStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_phoneValidator() : StyleValidator
    {
        return model_internal::_company_phoneValidator;
    }

    model_internal function set _company_phoneIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_phoneIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_phoneIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_phoneIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_phoneIsValid():Boolean
    {
        if (!model_internal::_company_phoneIsValidCacheInitialized)
        {
            model_internal::calculateCompany_phoneIsValid();
        }

        return model_internal::_company_phoneIsValid;
    }

    model_internal function calculateCompany_phoneIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_phoneValidator.validate(model_internal::_instance.company_phone)
        model_internal::_company_phoneIsValid_der = (valRes.results == null);
        model_internal::_company_phoneIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_phoneValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_phoneValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_phoneValidationFailureMessages():Array
    {
        if (model_internal::_company_phoneValidationFailureMessages == null)
            model_internal::calculateCompany_phoneIsValid();

        return _company_phoneValidationFailureMessages;
    }

    model_internal function set company_phoneValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_phoneValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_phoneValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_phoneValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get activestatusStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get activestatusValidator() : StyleValidator
    {
        return model_internal::_activestatusValidator;
    }

    model_internal function set _activestatusIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_activestatusIsValid;         
        if (oldValue !== value)
        {
            model_internal::_activestatusIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "activestatusIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get activestatusIsValid():Boolean
    {
        if (!model_internal::_activestatusIsValidCacheInitialized)
        {
            model_internal::calculateActivestatusIsValid();
        }

        return model_internal::_activestatusIsValid;
    }

    model_internal function calculateActivestatusIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_activestatusValidator.validate(model_internal::_instance.activestatus)
        model_internal::_activestatusIsValid_der = (valRes.results == null);
        model_internal::_activestatusIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::activestatusValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::activestatusValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get activestatusValidationFailureMessages():Array
    {
        if (model_internal::_activestatusValidationFailureMessages == null)
            model_internal::calculateActivestatusIsValid();

        return _activestatusValidationFailureMessages;
    }

    model_internal function set activestatusValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_activestatusValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_activestatusValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "activestatusValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get company_zipStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get company_zipValidator() : StyleValidator
    {
        return model_internal::_company_zipValidator;
    }

    model_internal function set _company_zipIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_company_zipIsValid;         
        if (oldValue !== value)
        {
            model_internal::_company_zipIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_zipIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get company_zipIsValid():Boolean
    {
        if (!model_internal::_company_zipIsValidCacheInitialized)
        {
            model_internal::calculateCompany_zipIsValid();
        }

        return model_internal::_company_zipIsValid;
    }

    model_internal function calculateCompany_zipIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_company_zipValidator.validate(model_internal::_instance.company_zip)
        model_internal::_company_zipIsValid_der = (valRes.results == null);
        model_internal::_company_zipIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::company_zipValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::company_zipValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get company_zipValidationFailureMessages():Array
    {
        if (model_internal::_company_zipValidationFailureMessages == null)
            model_internal::calculateCompany_zipIsValid();

        return _company_zipValidationFailureMessages;
    }

    model_internal function set company_zipValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_company_zipValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_company_zipValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_zipValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("cre_datetime"):
            {
                return cre_datetimeValidationFailureMessages;
            }
            case("company_email"):
            {
                return company_emailValidationFailureMessages;
            }
            case("company_address1"):
            {
                return company_address1ValidationFailureMessages;
            }
            case("country_name"):
            {
                return country_nameValidationFailureMessages;
            }
            case("company_city"):
            {
                return company_cityValidationFailureMessages;
            }
            case("company_fax"):
            {
                return company_faxValidationFailureMessages;
            }
            case("company_url"):
            {
                return company_urlValidationFailureMessages;
            }
            case("gst_code"):
            {
                return gst_codeValidationFailureMessages;
            }
            case("company_name"):
            {
                return company_nameValidationFailureMessages;
            }
            case("company_address2"):
            {
                return company_address2ValidationFailureMessages;
            }
            case("company_regno1"):
            {
                return company_regno1ValidationFailureMessages;
            }
            case("company_phone"):
            {
                return company_phoneValidationFailureMessages;
            }
            case("activestatus"):
            {
                return activestatusValidationFailureMessages;
            }
            case("company_zip"):
            {
                return company_zipValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
